<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <h:head>
        <title>APF Project</title>

        <link type="text/css" rel="stylesheet" href="theme.css" />
        
        
    </h:head>
    <h:body onload="dlg.show()">
        
        <p:growl id="growl" showDetail="true" life="3000" />  
  
        <p:dialog id="dialog" header="Login" height="220" width="350" widgetVar="dlg">  
            <h:form>  
  
                <h:panelGrid columns="2"  cellpadding="5">  
                    <h:outputLabel for="username" value="Login: *" />  
                    <p:inputText value="#{usuarioController.usuario.login}"   
                            id="login" required="true"  label="login" />  

                    <h:outputLabel for="password" value="Senha: * " />  
                    <h:inputSecret value="#{usuarioController.usuario.senha}"   
                            id="senha" required="true" label="senha" />  

                    <f:facet name="footer">  
                        <p:commandButton value="Login" update="growl"   
                            actionListener="#{usuarioController.logar}"   
                            />  
                    </f:facet>  
                </h:panelGrid>  
          
            </h:form>  
        </p:dialog>  
  
        <script type="text/javascript">  
            function handleLoginRequest(xhr, status, args) {  
                if(args.validationFailed || !args.loggedIn) {  
                    jQuery('#dialog').parent().effect("shake", { times:3 }, 100);  
                } 
            }  
        </script> 
    </h:body>
</html>